package com.xzx.springbootredis.service.impl;

import com.xzx.springbootredis.entity.Members;
import com.xzx.springbootredis.mapper.MembersMapper;
import com.xzx.springbootredis.service.MembersService;
import com.xzx.springbootredis.utils.Tool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MembersServiceImpl implements MembersService {
    @Autowired
    private MembersMapper membersMapper;

    @Override
    public int insertMembers(Members members) {
        members.setCreatedTime(Tool.getCurrentTime());
        return membersMapper.insert(members);
    }

    @Override
    public Members getMembersByUsernameOrMobile(String username) {
        return membersMapper.getMembersByUsernameOrMobile(username);
    }

    @Override
    public int updateMobile(Long id, String mobile) {
        return membersMapper.updateMobile(id, mobile);
    }
}